<?xml version="1.0" encoding="ascii"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>chimera.util.dumper</title>
  <link rel="stylesheet" href="epydoc.css" type="text/css" />
  <script type="text/javascript" src="epydoc.js"></script>
</head>

<body bgcolor="white" text="black" link="blue" vlink="#204080"
      alink="#204080">
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="chimera-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Project homepage -->
      <th class="navbar" align="right" width="100%">
        <table border="0" cellpadding="0" cellspacing="0">
          <tr><th class="navbar" align="center"
            ><a class="navbar" target="_top" href="http://chimera.ufsc.br/">Chimera - Observatoty Automation System</a></th>
          </tr></table></th>
  </tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
  <tr valign="top">
    <td width="100%">
      <span class="breadcrumbs">
        <a href="chimera-module.html">Package&nbsp;chimera</a> ::
        <a href="chimera.util-module.html">Package&nbsp;util</a> ::
        Module&nbsp;dumper
      </span>
    </td>
    <td>
      <table cellpadding="0" cellspacing="0">
        <!-- hide/show private -->
        <tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink"
    onclick="toggle_private();">hide&nbsp;private</a>]</span></td></tr>
        <tr><td align="right"><span class="options"
            >[<a href="frames.html" target="_top">frames</a
            >]&nbsp;|&nbsp;<a href="chimera.util.dumper-module.html"
            target="_top">no&nbsp;frames</a>]</span></td></tr>
      </table>
    </td>
  </tr>
</table>
<!-- ==================== MODULE DESCRIPTION ==================== -->
<h1 class="epydoc">Module dumper</h1><span class="codelink"><a href="chimera.util.dumper-pysrc.html">source&nbsp;code</a></span><br /><br />
<!-- ==================== FUNCTIONS ==================== -->
<a name="section-Functions"></a>
<table class="summary" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Functions</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-Functions"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="printDict"></a><span class="summary-sig-name">printDict</span>(<span class="summary-sig-arg">di</span>,
        <span class="summary-sig-arg">format</span>=<span class="summary-sig-default">&quot;%-25s %s&quot;</span>)</span></td>
          <td align="right" valign="top">
            <span class="codelink"><a href="chimera.util.dumper-pysrc.html#printDict">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="chimera.util.dumper-module.html#dumpObj" class="summary-sig-name">dumpObj</a>(<span class="summary-sig-arg">obj</span>,
        <span class="summary-sig-arg">maxlen</span>=<span class="summary-sig-default">77</span>,
        <span class="summary-sig-arg">lindent</span>=<span class="summary-sig-default">24</span>,
        <span class="summary-sig-arg">maxspew</span>=<span class="summary-sig-default">600</span>)</span><br />
      Print a nicely formatted overview of an object.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="chimera.util.dumper-pysrc.html#dumpObj">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="chimera.util.dumper-module.html#prettyPrintCols" class="summary-sig-name">prettyPrintCols</a>(<span class="summary-sig-arg">strings</span>,
        <span class="summary-sig-arg">widths</span>,
        <span class="summary-sig-arg">split</span>=<span class="summary-sig-default">' '</span>)</span><br />
      Pretty prints text in colums, with each string breaking at split 
      according to prettyPrint.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="chimera.util.dumper-pysrc.html#prettyPrintCols">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="chimera.util.dumper-module.html#prettyPrint" class="summary-sig-name">prettyPrint</a>(<span class="summary-sig-arg">string</span>,
        <span class="summary-sig-arg">maxlen</span>=<span class="summary-sig-default">75</span>,
        <span class="summary-sig-arg">split</span>=<span class="summary-sig-default">' '</span>)</span><br />
      Pretty prints the given string to break at an occurrence of split 
      where necessary to avoid lines longer than maxlen.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="chimera.util.dumper-pysrc.html#prettyPrint">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="chimera.util.dumper-module.html#nukenewlines" class="summary-sig-name">nukenewlines</a>(<span class="summary-sig-arg">string</span>)</span><br />
      Strip newlines and any trailing/following whitespace; rejoin with 
      a single space where the newlines were.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="chimera.util.dumper-pysrc.html#nukenewlines">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="delchars"></a><span class="summary-sig-name">delchars</span>(<span class="summary-sig-arg">str</span>,
        <span class="summary-sig-arg">chars</span>)</span><br />
      Returns a string for which all occurrences of characters in chars 
      have been removed.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="chimera.util.dumper-pysrc.html#delchars">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
</table>
<!-- ==================== FUNCTION DETAILS ==================== -->
<a name="section-FunctionDetails"></a>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Function Details</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-FunctionDetails"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
</table>
<a name="dumpObj"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">dumpObj</span>(<span class="sig-arg">obj</span>,
        <span class="sig-arg">maxlen</span>=<span class="sig-default">77</span>,
        <span class="sig-arg">lindent</span>=<span class="sig-default">24</span>,
        <span class="sig-arg">maxspew</span>=<span class="sig-default">600</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="chimera.util.dumper-pysrc.html#dumpObj">source&nbsp;code</a></span>&nbsp;
    </td>
  </table>
  
  <p>Print a nicely formatted overview of an object.</p>
  <p>The output lines will be wrapped at maxlen, with lindent of space for 
  names of attributes.  A maximum of maxspew characters will be printed for
  each attribute value.</p>
  <p>You can hand dumpObj any data type -- a module, class, instance, new 
  class.</p>
  <p>Note that in reformatting for compactness the routine trashes any 
  formatting in the docstrings it prints.</p>
  Example:
<pre class="py-doctest">
<span class="py-prompt">&gt;&gt;&gt; </span><span class="py-keyword">class</span> <span class="py-defname">Foo</span>(object):
<span class="py-output">        a = 30</span>
<span class="py-output">        def bar(self, b):</span>
<span class="py-output">            &quot;A silly method&quot;</span>
<span class="py-output">            return a*b</span>
<span class="py-output">... ... ... ... </span>
<span class="py-output"></span><span class="py-prompt">&gt;&gt;&gt; </span>foo = Foo()
<span class="py-prompt">&gt;&gt;&gt; </span>dumpObj(foo)
<span class="py-output">Instance of class 'Foo' as defined in module __main__ with id 136863308</span>
<span class="py-output">Documentation string:   None</span>
<span class="py-output">Built-in Methods:       __delattr__, __getattribute__, __hash__, __init__</span>
<span class="py-output">                        __new__, __reduce__, __repr__, __setattr__,       </span>
<span class="py-output">                        __str__</span>
<span class="py-output">Methods:</span>
<span class="py-output">  bar                   &quot;A silly method&quot;</span>
<span class="py-output">Attributes:</span>
<span class="py-output">  __dict__              {}</span>
<span class="py-output">  __weakref__           None</span>
<span class="py-output">  a                     30</span></pre>
  <dl class="fields">
  </dl>
</td></tr></table>
</div>
<a name="prettyPrintCols"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">prettyPrintCols</span>(<span class="sig-arg">strings</span>,
        <span class="sig-arg">widths</span>,
        <span class="sig-arg">split</span>=<span class="sig-default">' '</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="chimera.util.dumper-pysrc.html#prettyPrintCols">source&nbsp;code</a></span>&nbsp;
    </td>
  </table>
  
  Pretty prints text in colums, with each string breaking at split 
  according to prettyPrint.  margins gives the corresponding right breaking
  point.
  <dl class="fields">
  </dl>
</td></tr></table>
</div>
<a name="prettyPrint"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">prettyPrint</span>(<span class="sig-arg">string</span>,
        <span class="sig-arg">maxlen</span>=<span class="sig-default">75</span>,
        <span class="sig-arg">split</span>=<span class="sig-default">' '</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="chimera.util.dumper-pysrc.html#prettyPrint">source&nbsp;code</a></span>&nbsp;
    </td>
  </table>
  
  <p>Pretty prints the given string to break at an occurrence of split 
  where necessary to avoid lines longer than maxlen.</p>
  This will overflow the line if no convenient occurrence of split is 
  found
  <dl class="fields">
  </dl>
</td></tr></table>
</div>
<a name="nukenewlines"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">nukenewlines</span>(<span class="sig-arg">string</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="chimera.util.dumper-pysrc.html#nukenewlines">source&nbsp;code</a></span>&nbsp;
    </td>
  </table>
  
  <p>Strip newlines and any trailing/following whitespace; rejoin with a 
  single space where the newlines were.</p>
  Bug: This routine will completely butcher any whitespace-formatted 
  text.
  <dl class="fields">
  </dl>
</td></tr></table>
</div>
<br />
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="chimera-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Project homepage -->
      <th class="navbar" align="right" width="100%">
        <table border="0" cellpadding="0" cellspacing="0">
          <tr><th class="navbar" align="center"
            ><a class="navbar" target="_top" href="http://chimera.ufsc.br/">Chimera - Observatoty Automation System</a></th>
          </tr></table></th>
  </tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
  <tr>
    <td align="left" class="footer">
    <a href="epydoc-log.html">Generated by Epydoc
    3.0beta1 on Sat Feb  7 18:36:49 2009</a>
    </td>
    <td align="right" class="footer">
      <a href="http://epydoc.sourceforge.net">http://epydoc.sourceforge.net</a>
    </td>
  </tr>
</table>

<script type="text/javascript">
  <!--
  // Private objects are initially displayed (because if
  // javascript is turned off then we want them to be
  // visible); but by default, we want to hide them.  So hide
  // them unless we have a cookie that says to show them.
  checkCookie()
  // -->
</script>
  
</body>
</html>
